#ifndef TASKLIST_H
#define TASKLIST_H

#include <QVector>
#include "TaskItem.h"

class QTimer;
class QVBoxLayout;
class QMenu;


class TaskList : public QWidget
{
    Q_OBJECT
public:
    explicit TaskList(QWidget *parent = nullptr);
    void setTasks(const QVector<ScheduleDataInfo> &tasks);

private:
    QVBoxLayout *m_layout;
    QTimer *m_minuteTimer;
    QTimer *m_secondTimer;
    QMenu *m_menu;
    QAction *m_setCountdownModeAction;
    QAction *m_setPiningModeAction;
    QAction *m_setNormalModeAction;
    QList<TaskItem*> m_items;


private slots:
    void freshTaskItems();
    void freshCountdownTaskItems();
    void moveTaskItems();
    void onSetTaskMode();
    void showMenu(QPoint globalPos);
    void onItemFaded();
signals:

};


#endif // TASKLIST_H
